﻿using System;
using System.Collections.Generic;
using System.Security.Claims;
using JetBrains.Annotations;
using TianShu.DependencyInjection;

namespace TianShu.Users
{
    public interface ICurrentUser
    {

        [CanBeNull]
        Guid? Id { get; }

        [CanBeNull]
        string UserName { get; }

        [CanBeNull]
        string Name { get; }

        [CanBeNull]
        string Account { get; }

        [CanBeNull]
        string PhoneNumber { get; }


        [CanBeNull]
        string Email { get; }

        [CanBeNull]
        List<Guid> OrgIds { get; }

        string ShiftName { get; }
        Guid? ShiftId { get; }
        string ClassPeriodName { get; }
        Guid? ClassPeriodId { get; }


        Guid? TenantId { get; }
        /// <summary>
        /// 是否授权
        /// </summary>
        bool IsAuthenticated { get; }

        [NotNull]
        string[] Roles { get; }

        [CanBeNull]
        Claim FindClaim(string claimType);

        [NotNull]
        Claim[] FindClaims(string claimType);

        [NotNull]
        Claim[] GetAllClaims();

        bool IsInRole(string roleName);
    }
}
